require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'

class TC_Home < Test::Unit::TestCase
  def test_08_ValidatingAnAdminCanAddAJpgPictureToTheWelcomeMessage
    $ie.goto($UniVar)
    $ie.refresh()
    
    $ie.div(:id, /ctl00_ctl00_rcr_rcr_ctl00_ctl00_content/).fire_event('onDblClick')
    $ie.frame(:index, 1).image(:title, 'Insert/edit image').click
    
    ie2 = Watir::IE.attach(:title, 'Insert/edit image')
    ie2.text_field(:index, 1).value = "http://telligent.com/Themes/Telligent/images/placeholder2.gif"
    ie2.text_field(:index, 2).value = "telligent logo"
    ie2.button(:id, /insert/).click
    
    $ie.frame(:index, 1).button(:caption, ' Save Changes ').click
    assert($ie.contains_text('This is the new featured text.'))
    
    assert($ie.image(:src, 'http://telligent.com/Themes/Telligent/images/placeholder2.gif').exists?)
  end
end
